var timeChunk = function (ary, fn, count, interval) {
    var obj,t;
    var len = ary.length;
    var start = function () {
        for(var i = 0;i<Math.min(count||1,ary.length);i++){
            var obj = ary.shift();
            fn(obj);
        };
    };
    return function () {
        t = setInterval(function () {
            if(ary.length===0){
                return clearInterval(t);
            };
            start();
        },interval);
    };
};

var ary = [];
for (var i=1;i<=1000;i++){
    ary.push(i);
}
var p = timeChunk(ary,function (n) {
    console.log(n)
},10,1000);

p();